#include "If.h"


If::If(Expr *_cond, Expr *_dest, int _ln)
    :cond(_cond), dest(_dest), Stmt(_ln)
{
}


If::~If(void)
{
    delete dest;
    delete cond;
}

int If::Eval()
{
    if (cond->EvalInt())
    {
        return dest->EvalInt();
    }
    else
    {
        return -1;
    }
}
